### RP Skelton 24 November 2022

# Edited again 27 June 2023

# load packages if necessary

# setwd("C:\\Users\\danie\\OneDrive - Nelson Mandela University\\Documents\\University\\2020-2021\\Thicket hydrualics\\Publication\\Results")
setwd("C://Users/rober/OneDrive/Documents/Thicket/raw data")

# wp drought period
# Sept 2020
wp.dry.dat <- read.csv("05_InFieldWaterPotential_Sept2020.csv",header=T)
wp.d.sp <- round(tapply(wp.dry.dat$Water_potential_MPa,wp.dry.dat$species,mean,na.rm=T),2)
wp.d.sp.se <- round(tapply(wp.dry.dat$Water_potential_MPa,wp.dry.dat$species,se),2)
wp.d.all.p <- wp.d.sp + wp.d.sp.se
wp.d.all.n <- wp.d.sp - wp.d.sp.se

# Nov 2022
wp.dat <- read.csv("05_InFieldWaterPotential_Nov2022.csv",header=T)
wp.sp <- round(tapply(wp.dat$Water_potential_MPa,wp.dat$Genus,mean,na.rm=T),2)
wp.sp.se <- round(tapply(wp.dat$Water_potential_MPa,wp.dat$Genus,se),2)
wp.all.p <- wp.sp + wp.sp.se
wp.all.n <- wp.sp - wp.sp.se

